package mango.web;

public class Info {
    public static final int ERROR = -1;
    public static final int SUCCESS = 0;
    public static final int WARNING = 1;
    public static final int INFO = 2;
    public static final int CONFIRM = 3;
    public static final int TIMEOUT = 9;
    
    private int type;
    private boolean success;
    private String msg;

    public Info(int type, boolean success, String msg) {
        this.type = type;
        this.success = success;
        this.msg = msg;
    }

    public String toJSON() {
        StringBuilder ret = new StringBuilder();
        ret.append("{success : ").append(this.success).append(", type : ").append(this.type)
                .append(", msg: \"").append(this.msg).append("\"}");
        return ret.toString();
    }

}
